/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.servinf.ani.sincronizador.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author mortiz
 */
@Entity
@Table(name = "servicios_x_area", catalog = "ani_admin", schema = "public")
@NamedQueries({
    @NamedQuery(name = "ServiciosXArea.findAll", query = "SELECT s FROM ServiciosXArea s")})
public class ServiciosXArea implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_servicio_area")
    private Integer idServicioArea;
    @Basic(optional = false)
    private String link;
    private String descripcion;
    @JoinColumn(name = "codigo_via", referencedColumnName = "codigo_via")
    @ManyToOne(optional = false)
    private TramoVia codigoVia;
    @JoinColumn(name = "id_area", referencedColumnName = "id_area")
    @ManyToOne
    private Area idArea;

    public ServiciosXArea() {
    }

    public ServiciosXArea(Integer idServicioArea) {
        this.idServicioArea = idServicioArea;
    }

    public ServiciosXArea(Integer idServicioArea, String link) {
        this.idServicioArea = idServicioArea;
        this.link = link;
    }

    public Integer getIdServicioArea() {
        return idServicioArea;
    }

    public void setIdServicioArea(Integer idServicioArea) {
        this.idServicioArea = idServicioArea;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public TramoVia getCodigoVia() {
        return codigoVia;
    }

    public void setCodigoVia(TramoVia codigoVia) {
        this.codigoVia = codigoVia;
    }

    public Area getIdArea() {
        return idArea;
    }

    public void setIdArea(Area idArea) {
        this.idArea = idArea;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idServicioArea != null ? idServicioArea.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ServiciosXArea)) {
            return false;
        }
        ServiciosXArea other = (ServiciosXArea) object;
        if ((this.idServicioArea == null && other.idServicioArea != null) || (this.idServicioArea != null && !this.idServicioArea.equals(other.idServicioArea))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.servinf.ani.sincronizador.entities.ServiciosXArea[ idServicioArea=" + idServicioArea + " ]";
    }
    
}
